﻿using System.Collections.Generic;
using InvestmentIntelligence.DbModel.Models;

namespace InvestmentIntelligence.Data.Repository.Comparers.EntityModelsComparers
{
    public class BookSecurityToBenchmarkComparer : IEqualityComparer<BookSecurityToBenchmark>
    {
        public bool Equals(BookSecurityToBenchmark x, BookSecurityToBenchmark y)
        {
            return x.FundBookEntityId == y.FundBookEntityId && x.SecurityId == y.SecurityId;
        }

        public int GetHashCode(BookSecurityToBenchmark obj)
        {
            return obj.FundBookEntityId.GetHashCode() ^ obj.SecurityId.GetHashCode();
        }
    }
}